{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ebd453cd-4839-4a63-9746-16bc6efbb4e7",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.datasets import load_iris\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.ensemble import AdaBoostClassifier\n",
    "from sklearn.tree import DecisionTreeClassifier\n",
    "from sklearn.metrics import accuracy_score\n",
    "from sklearn.model_selection import GridSearchCV\n",
    "from sklearn.model_selection import StratifiedShuffleSplit\n",
    "x,y=load_iris().data[:,2:4],load_iris().target\n",
    "x_train,x_test,y_train,y_test=train_test_split(x,y,random_state=0,test_size=50)\n",
    "param_grid={'n_estimators':[10,20,30,40,50,60,70,80,90,100],'learning_rate':[0.0001,0.0005,0.001,0.005,0.01,0.05,0.1,0.5,0.6,0.7,0.8,0.9]}\n",
    "cv=StratifiedShuffleSplit(n_splits=5,test_size=0.3,random_state=420)\n",
    "grid=GridSearchCV(AdaBoostClassifier(DecisionTreeClassifier(criterion='gini',max_depth=3),random_state=0),param_gird=param_grid,cv=cv)\n",
    "grid.fit(x_train,y_train"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
